package com.candy.security.jwt.entity;

import com.candy.security.jwt.service.AuthenticationService;
import org.springframework.security.core.userdetails.User;

public class CandyUserdetails extends User
{
	private LoginUser loginUser;
	public CandyUserdetails(LoginUser loginUser, String password)
	{
		super(loginUser.getLoginName(), password+"@"+loginUser.getLoginName(), AuthenticationService.getAuthorities(loginUser.getAuthorities()));
		this.loginUser=loginUser;
	}

	public LoginUser getLoginUser()
	{
		return loginUser;
	}
}
